#include "HashSearch.h"
#include <string.h>

int HashSearch::SetUpData(int* pData, int iLen)
{
    m_setData.clear();
    for (int i = 0; i < iLen; ++i)
    {
        m_setData.insert(pData[i]);
    }
    return 0;
}

int HashSearch::Test(int iKey)
{
	unordered_set<int>::iterator it = m_setData.find(iKey);
    if (it == m_setData.end())
    {
        return -1;
    }
    else
    {
        return *it;
    }
}

